panakotta00
03/20/2022, 5:10 PMJoey
03/20/2022, 5:14 PM--log-level=trace
and send logs when it happens; they might provide some insightpanakotta00
03/20/2022, 5:24 PMpanakotta00
03/20/2022, 5:24 PMpanakotta00
03/20/2022, 5:35 PM5:30PM INF Query args=[] module=pgx pid=44492 rowCount=1 sql="SELECT NOW()"
5:30PM INF Query args=["2022-03-19T17:30:45.838271Z"] module=pgx pid=44492 rowCount=1 sql="SELECT MAX(id) FROM relation_tuple_transaction WHERE timestamp < $1"
5:30PM INF Exec args=[117] commandTag=REVMRVRFIDA= module=pgx pid=44492 sql="WITH rows AS (SELECT id FROM relation_tuple WHERE deleted_transaction <= $1)\n\t\t DELETE FROM relation_tuple\n\t\t WHERE id IN (SELECT id FROM rows);\n\t"
5:30PM INF Exec args=[117] commandTag=REVMRVRFIDA= module=pgx pid=44492 sql="WITH rows AS (SELECT id FROM relation_tuple_transaction WHERE id < $1)\n\t\t DELETE FROM relation_tuple_transaction\n\t\t WHERE id IN (SELECT id FROM rows);\n\t"
This seems to be the call where it essentially removes old cache stuff (idk)
What I'm confused about is that 117...
in the realtion_tuple table i have found these entries related to the admin relationpanakotta00
03/20/2022, 5:36 PMpanakotta00
03/20/2022, 5:37 PMpanakotta00
03/20/2022, 5:38 PM5:37PM INF started call grpc.code=OK grpc.component=server grpc.method=CheckPermission grpc.method_type=unary grpc.service=authzed.api.v1.PermissionsService grpc.start_time=2022-03-20T17:37:49Z grpc.time_ms=0.016 peer.address=172.17.0.1:43426 protocol=grpc requestID=5d7b32b1c1b31969f070cb6518fd1e8d
5:37PM INF Query args=[] module=pgx pid=44492 rowCount=1 sql="SELECT NOW()"
5:37PM INF Query args=["2022-03-20T17:37:45.130627Z"] module=pgx pid=44492 rowCount=1 sql="SELECT MIN(id), MAX(id) FROM relation_tuple_transaction WHERE timestamp >= $1"
5:37PM TRC adding sample duration to statistics duration=3.107615 requestID=5d7b32b1c1b31969f070cb6518fd1e8d
5:37PM INF finished call grpc.code=OK grpc.component=server grpc.method=CheckPermission grpc.method_type=unary grpc.service=authzed.api.v1.PermissionsService grpc.start_time=2022-03-20T17:37:49Z grpc.time_ms=3.569 peer.address=172.17.0.1:43426 protocol=grpc requestID=5d7b32b1c1b31969f070cb6518fd1e8d
This is btw the output when i reques to check the permission for edit_tags, while it should return true because the relation should exist, but instead it returned falsepanakotta00
03/20/2022, 5:48 PMpanakotta00
03/20/2022, 5:48 PMglobal:0#admin@user:1484971115573936128
panakotta00
03/20/2022, 5:49 PMglobal:0#edit_tags@user:1484971115573936128
results in either false
or an error `Error: rpc error: code = FailedPrecondition desc = failed precondition: object definition global
not found`panakotta00
03/20/2022, 5:51 PMdefinition user {
// relation global: global
relation self: user
}
definition global {
relation admin: user
permission edit_tags = admin
permission moderate_users = admin
}
definition package {
relation global: global
relation owner: user
permission write = owner
permission moderate = global->admin
permission view_all = write + moderate
}
definition release {
relation package: package
permission write = package->write
permission moderate = package->moderate
permission view_all = write + moderate
}
(i removed the user global thingy because maybe that influenced it, apperently it didnt)panakotta00
03/20/2022, 5:52 PMpanakotta00
03/20/2022, 5:52 PMpanakotta00
03/20/2022, 5:52 PMpanakotta00
03/20/2022, 5:53 PMpanakotta00
03/20/2022, 5:53 PMpanakotta00
03/20/2022, 5:55 PMpanakotta00
03/20/2022, 5:56 PMJoey
03/20/2022, 6:03 PMpanakotta00
03/20/2022, 6:04 PMJoey
03/20/2022, 6:05 PM["2022-03-19T17:54:36.851157Z"]
Joey
03/20/2022, 6:05 PMpanakotta00
03/20/2022, 6:05 PMJoey
03/20/2022, 6:05 PMJoey
03/20/2022, 6:05 PMJoey
03/20/2022, 6:05 PMJoey
03/20/2022, 6:05 PMpanakotta00
03/20/2022, 6:05 PMJoey
03/20/2022, 6:05 PMJoey
03/20/2022, 6:05 PMpanakotta00
03/20/2022, 6:06 PMpanakotta00
03/20/2022, 6:06 PMJoey
03/20/2022, 6:06 PMJoey
03/20/2022, 6:07 PMpanakotta00
03/20/2022, 6:07 PMJoey
03/20/2022, 6:07 PMJoey
03/20/2022, 6:07 PMpanakotta00
03/20/2022, 6:07 PMJoey
03/20/2022, 6:07 PMJoey
03/20/2022, 6:07 PMpanakotta00
03/20/2022, 6:07 PMJoey
03/20/2022, 6:08 PMJoey
03/20/2022, 6:08 PMJoey
03/20/2022, 6:08 PMSELECT NOW()
in your DB return?Joey
03/20/2022, 6:09 PMpanakotta00
03/20/2022, 6:09 PMJoey
03/20/2022, 6:09 PMJoey
03/20/2022, 6:09 PMJoey
03/20/2022, 6:10 PMrelation_tuple_transaction
should be in UTCJoey
03/20/2022, 6:10 PMJoey
03/20/2022, 6:11 PMselect * from relation_tuple_transaction
shows for the new transaction's timestamp?Joey
03/20/2022, 6:11 PMpanakotta00
03/20/2022, 6:11 PMdate
returns Sun 20 Mar 2022 07:10:34 PM CET
Joey
03/20/2022, 6:12 PMpanakotta00
03/20/2022, 6:12 PMpanakotta00
03/20/2022, 6:13 PMpanakotta00
03/20/2022, 6:13 PMJoey
03/20/2022, 6:13 PMpanakotta00
03/20/2022, 6:14 PMpanakotta00
03/20/2022, 6:14 PMpanakotta00
03/20/2022, 6:14 PMJoey
03/20/2022, 6:14 PMpanakotta00
03/20/2022, 6:14 PMpanakotta00
03/20/2022, 6:15 PMpanakotta00
03/20/2022, 6:15 PMJoey
03/20/2022, 6:16 PMpanakotta00
03/20/2022, 6:16 PMJoey
03/20/2022, 6:17 PMJoey
03/20/2022, 6:17 PMJoey
03/20/2022, 6:17 PMJoey
03/20/2022, 6:17 PM6
)Joey
03/20/2022, 6:17 PM8
nowpanakotta00
03/20/2022, 6:17 PM6:17PM INF started call grpc.code=OK grpc.component=server grpc.method=CheckPermission grpc.method_type=unary grpc.service=authzed.api.v1.PermissionsService grpc.start_time=2022-03-20T18:17:33Z grpc.time_ms=0.02 peer.address=172.17.0.1:43792 protocol=grpc requestID=d0345fefabf7f9baa000a6ca2e5256e8
6:17PM INF Query args=[] module=pgx pid=46304 rowCount=1 sql="SELECT NOW()"
6:17PM INF Query args=["2022-03-20T18:17:29.443729Z"] module=pgx pid=46304 rowCount=1 sql="SELECT MIN(id), MAX(id) FROM relation_tuple_transaction WHERE timestamp >= $1"
6:17PM TRC adding sample duration to statistics duration=5.889633 requestID=d0345fefabf7f9baa000a6ca2e5256e8
6:17PM INF finished call grpc.code=OK grpc.component=server grpc.method=CheckPermission grpc.method_type=unary grpc.service=authzed.api.v1.PermissionsService grpc.start_time=2022-03-20T18:17:33Z grpc.time_ms=6.397 peer.address=172.17.0.1:43792 protocol=grpc requestID=d0345fefabf7f9baa000a6ca2e5256e8
Joey
03/20/2022, 6:18 PMJoey
03/20/2022, 6:18 PM2022-03-20T18:17:29.443729Z
Joey
03/20/2022, 6:18 PMSELECT MIN(id), MAX(id) FROM relation_tuple_transaction WHERE timestamp >= "2022-03-20T18:17:29.443729Z"
return?panakotta00
03/20/2022, 6:20 PMpanakotta00
03/20/2022, 6:21 PMpanakotta00
03/20/2022, 6:21 PMJoey
03/20/2022, 6:21 PMpanakotta00
03/20/2022, 6:21 PMJoey
03/20/2022, 6:21 PMJoey
03/20/2022, 6:22 PMpanakotta00
03/20/2022, 6:22 PMJoey
03/20/2022, 6:23 PMJoey
03/20/2022, 6:23 PMJoey
03/20/2022, 6:23 PMpanakotta00
03/20/2022, 6:23 PMpanakotta00
03/20/2022, 6:24 PMpanakotta00
03/20/2022, 6:28 PMJoey
03/20/2022, 6:28 PMJoey
03/20/2022, 6:29 PMNOW()
is returning the time with timezoneJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:29 PMJoey
03/20/2022, 6:30 PMpanakotta00
03/20/2022, 6:41 PMJoey
03/20/2022, 6:45 PMpanakotta00
03/20/2022, 6:45 PMpanakotta00
03/20/2022, 6:45 PMpanakotta00
03/20/2022, 6:45 PMJoey
03/20/2022, 6:47 PMJoey
03/20/2022, 6:47 PMJoey
03/20/2022, 6:49 PMJoey
03/20/2022, 6:49 PMJoey
03/20/2022, 6:49 PMJoey
03/20/2022, 6:49 PMdate
as UTCJoey
03/20/2022, 6:50 PMJoey
03/20/2022, 6:50 PMpanakotta00
03/20/2022, 6:52 PMpanakotta00
03/20/2022, 6:52 PMJoey
03/20/2022, 6:53 PMJoey
03/20/2022, 6:53 PMJoey
03/20/2022, 6:53 PMJoey
03/20/2022, 6:53 PMpanakotta00
03/20/2022, 7:02 PMpanakotta00
03/20/2022, 7:04 PMALTER DATABASE "MyDBNameHere" SET timezone TO 'UTC';
and then restarting spicedb
that workedpanakotta00
03/20/2022, 7:04 PMJoey
03/20/2022, 7:06 PM